1. Technical Field
The present invention relates to a computer device with an auxiliary storage or a control method therefor, and in particular, to a device or method to enhance the overall system performance by using a cache memory.
2. Description of the Related Art
A recent computer system includes a CPU, a system memory, and auxiliary storage (external storage) represented by an HDD (Hard Disk Drive), and each of these components has a different data rate. When considering the performance of such a computer system, it is found that the HDD and other auxiliary storage are much slower than the CPU and the system memory in terms of data rate. Since the data rate of the overall system generally depends on the slower devices, any delay in these auxiliary storage devices may cause a bottleneck in the overall system performance.
To reduce a difference in speed between these devices to increase the processing speed, a computer system typically has a cache memory provided therein. The cache memory is placed, for example, between the CPU and a main storage, and any data or instruction used by the CPU once is retained in the cache memory, which is faster than the main storage. For subsequent uses, such data or instruction is read out from the cache memory and is not placed directly into the main storage to provide faster processing.
In addition, the HDD as an auxiliary storage (external storage) has a cache memory provided therein to hold some of the data stored in its magnetic disks (media) and is configured to improve its basic performance and to minimize the number of accesses to the slower media by prestoring in the cache memory some data which is expected to be requested later. When the data to be requested is thus prestored in the cache memory, the access time for the HDD does not cause a bottleneck in the overall system performance.
To predict data to be requested later, a data read-ahead algorithm called xe2x80x9cLook Aheadxe2x80x9d is most commonly used. The xe2x80x9cLook Aheadxe2x80x9d algorithm is a technique of prereading some data subsequent to the requested data (some data at larger addresses than the requested address), that is, a technique of reading some data in the area contiguous to the requested data after the data requested by a host device has been read out from the requested area.
The xe2x80x9cLook Aheadxe2x80x9d algorithm can minimize overhead required for processing by always prereading subsequent data, regardless of the previous request patterns. To really improve the performance through this technique, it is ideal to analyze the pattern of requests from an application or OS thoroughly for accurate prediction of subsequent requests.
An auxiliary storage represented by an HDD traces which commands have been issued and easily predicts which data are to be access-requested next. Therefore, the HDD is configured to improve the performance by prestoring thus predicted data in its internal cache memory. However, a request issued to, for example, an HDD is not a true request from the application or OS but is actually a request pattern, modified by collecting or rearranging several access requests through a hard disk controller (HDC). Thus, the HDD cannot analyze the true request pattern and it is difficult to increase the cache hit rate for reading.
An internal controller provided within the HDD or other auxiliary storage must trace commands from the host while controlling read/write accesses to a medium, which is the original task. Therefore, a thorough analysis or parsing on the pattern of requests from the application or OS may impose too large loads on the internal controller and it is indeed difficult to carry out such a thorough analysis or parsing.
The present invention has been made to solve the technical problems as described above, and it is an object of the present invention to cause the HDD or other auxiliary storage to cooperate with the HDC or other external controller in improving the overall system performance.
It is another object of the present invention to carry out a thorough analysis or parsing through the external controller based on a true request from the application or OS and to pre issue to the auxiliary storage a xe2x80x9cspeculationxe2x80x9d request based on a true xe2x80x9cprediction.xe2x80x9d
It is still another object of the present invention to provide a mechanism to cancel a request being executed or an unexecuted request to minimize a possible performance deterioration which may result from a wrong prediction.
To attain these and other objects, a controller device according to an embodiment of the present invention is provided between auxiliary storage which stores data and a host device which makes an access request for access to the auxiliary storage. The controller device, which controls the auxiliary storage, comprises access request storage means for storing past access requests made by the host device, look-ahead request output means for providing to the auxiliary storage a look-ahead request for some data which is expected to be access-requested later based on the past access requests stored by the access request storage means, and cancel signal output means for providing to the auxiliary storage a cancel signal to cancel a particular look-ahead request among the look-ahead requests provided by the look-ahead request output means.
This controller device may take the form of, for example, a hard disk controller card (HDC card) provided between a PC, or host and a hard disk drive or other auxiliary storage. As an alternative form, the PC or host itself may have the function of this controller device so that the controller device is substantially provided between the host device and the auxiliary storage. The controller device may take any form if it can be discriminated from an internal controller provided in the auxiliary storage.
It is preferable that a look-ahead request for data provided by the look-ahead request output means is a non queue request that is executed immediately or a tagged queue request that is temporarily held in the auxiliary storage in a queue, since this can allow an optimal request to be transmitted to the auxiliary storage according to a predicted command.
In particular, it is advantageous that a cancel signal provided by the cancel signal output means is a cancel signal with a tag number to be canceled with respect to the tagged queue request, since this can allow an arbitrary command being executed to be canceled in order to improve the overall system performance.
Alternatively, a cancel signal provided by the cancel signal output means may be a command to extend a xe2x80x9cNo Operationxe2x80x9d (NOP) command for an ATA-related interface with a tag number to be cancelled as an argument.
In addition, a cancel signal provided by the cancel signal output means with respect to a command being executed may be a signal to suspend only the command being executed by using a blank bit in a device control register for the ATA-related interface to issue a soft reset.
It should be appreciated that the ATA (AT Attachment), related interface may include an associated ATAPI (ATA Packet Interface) or other extended protocol.
A disk controller according to another embodiment of the present invention is connected to a disk-shaped storage which stores data and has a cache memory. The disk controller, which controls the disk-shaped storage, comprises an access request tracer for tracing a true access request made by an application program executed by a host with respect to the disk-storage directly from the application program, a speculation request determination section for determining a speculation request to be expected later based on the true access request traced by the access request tracer, and an access request issuing section for issuing to the disk-shaped storage a speculation request determined by the speculation request determination section.
It is preferable that a xe2x80x9ctrue access requestxe2x80x9d is not a request modified by collecting or rearranging several access requests, but an intact request from the application program, since this can improve the accuracy in prediction remarkably.
In addition, it is preferable that the access request tracer takes the form of a tracer which can store a plurality of access requests from the application program together with their order information to grasp the traces of the access requests.
It should be appreciated that the disk controller may take any form if it can be discriminated from an internal controller provided in the disk-shaped storage. It is advantageous that some of the tasks performed by the internal controller in the disk-shaped storage can be made over by discriminating between these controllers and thus much more excellent an analysis can be made on access request patterns.
It is also advantageous if the disk controller further comprises a cancel request determination section for determining a particular speculation request to be canceled among the speculation requests issued by the access request issuing section, and a cancel instruction issuing section for issuing to the disk-shaped storage a cancel instruction with respect to the particular speculation request determined by the cancel request determination section, since a request being executed or an unexecuted request can be canceled as required. A possible performance deterioration which may result from a wrong prediction can thus be minimized.
The speculation request issued by the access request issuing section may be a request to immediately read out data from a medium in the disk-shaped storage, and the cancel instruction issued by the cancel instruction issuing section may be an instruction to suspend the request being executed. This can allow quick cancellation of a request being executed in order to improve performance.
Alternatively, the speculation request issued by the access request issuing section may be a request for a command held in the disk-shaped storage in a queue with a tag number and the cancel instruction issued by the cancel instruction issuing section may be an instruction to cancel a request corresponding to a particular tag number among the requests in the queue. This can allow a plurality of requests to be placed in the xe2x80x9cqueuexe2x80x9d and avoid any unnecessary access to an unexecuted request by deleting the request from the xe2x80x9cqueuexe2x80x9d even when a prediction is wrong.
An auxiliary storage device according to still another embodiment of the present invention comprises a storage medium for storing data, a cache memory for temporarily accumulating data read out from the storage medium in response to executing a predicted read request, an interface for receiving from an external controller a predicted read request with respect to the cache memory with tag number information, and a controller for holding a plurality of unexecuted requests in a queue which includes the predicted read request received by the interface and identified by the tag number. The interface receives from the external controller a cancel signal with a particular tag number for a request to be canceled, and the controller analyzes the cancel signal and deletes a request corresponding to the particular tag number from the queue.
It should be appreciated that the controller can execute a plurality of requests in a different order from that of placing them in the xe2x80x9cqueue,xe2x80x9d taking account of the efficiency in executing them in the auxiliary storage in the order.
In addition, an unexecuted request can be canceled easily and a possible performance deterioration which may result from a wrong prediction of the external controller can be minimized.
It is further advantageous that the interface can notify the external controller which data of the data being read is valid if a request being executed is canceled, since the external controller can accurately determine the next predicted read request to be transmitted.
A computer device to which the present invention is applicable comprises a host for executing application programs, an external storage which has a cache memory, an internal controller for reading/writing data based on an access request from the host, and a controller for controlling the external storage. The controller provides to the external storage a look-ahead request for some data which is expected to be access-requested later based on the access request provided by the host. The controller also provides to the external storage a cancel signal to cancel the look-ahead request.
The look-ahead request may be a request to immediately read out data from a storage medium in the external storage to the cache memory and the cancel signal may be a signal to suspend a command being executed in response to the request. Alternatively, the look-ahead request may be a request for a command managed by the internal controller in the external storage with an identification number attached thereto, and the cancel signal may be a signal to specify a particular identification number for a command to be canceled among the commands managed by the internal controller.
In addition, it is preferable that the external storage analyzes the cancel signal provided by the controller to cancel a look-ahead request and provides to the controller the last valid data information indicating the end of valid data among the data written into the cache memory, since this can allow the controller to effectively take advantage of some of the data requested by a canceled request.
A control method for an auxiliary storage according to the present invention comprises the step of receiving a command issued by an application, the step of analyzing the flow of the command received from the application, the step of determining whether a speculation command is required to indicate data to be read ahead based on the flow of the analyzed command, the step of issuing the speculation command to the auxiliary storage if it is determined that the speculation command is required, the step of verifying previously issued speculation commands, and the step of issuing a cancel command to the auxiliary storage if it is determined from the verification result that there exists an unnecessarily issued speculation command.
It is preferable that the speculation command includes a request to immediately read out data from a medium in the auxiliary storage and the cancel command suspends the speculation command being executed, since this can allow a request being executed to be canceled properly.
The speculation command may include a request to be held in the auxiliary storage in a queue, and the cancel command may select a particular command among the commands held in the queue by the speculation command and delete it from the queue. Alternatively, the speculation command may include a request to be held with a tag number, and the cancel command may specify a tag number to be canceled, since the speculation command can be canceled by issuing a simple instruction with a tag number with respect to a tagged queue request held in the auxiliary storage in the form of a xe2x80x9cqueue.xe2x80x9d
It is also advantageous that the method further comprises the step of receiving from the auxiliary storage the last valid data information after a cancel operation is completed, since this can effectively take advantage of some data accessed previously, for example, in order to improve the overall system performance.